<!DOCTYPE html>
<html>
    <head>
        <?
        require_once 'header.php';
        //$dados = "7.0, 6.9, 9.5, 14.5, 18.2, 21.5, 25.2, 26.5, 23.3, 18.3";
        $dados = "";
        $estatisticas = $evento->getEstatisticas();
        $categorias = "";
        foreach ($estatisticas as $estatitica) {
            $dados = $dados . $estatitica->getHora() . ", ";
            $categorias = $categorias . "'" . date('d m Y', strtotime($estatitica->getData())) . "'" . " ,";
        }
        ?>
        <script type="text/javascript">
            $(function() {
                $('#container').highcharts({
                    title: {
                        text: 'Estatisticas',
                        x: -20 //center
                    },
                    subtitle: {
                        text: '',
                        x: -20
                    },
                    xAxis: {
                        title: {
                            text: 'Data'
                        },
                        categories: [<? echo $categorias ?>]
                                //'20/09/13', '20/09/13', '20/09/13', '20/09/13', '20/09/13', '20/09/13',
                                //'20/09/13', '20/09/13', '20/09/13', '20/09/13', '20/09/13', '20/09/13']
                    },
                    yAxis: {
                        title: {
                            text: 'Acessos'
                        },
                        plotLines: [{
                                value: 0,
                                width: 1,
                                color: '#808080'
                            }]
                    },
                    tooltip: {
                        valueSuffix: ' Acesso(s)'
                    },
                    legend: {
                        layout: 'vertical',
                        align: 'right',
                        verticalAlign: 'middle',
                        borderWidth: 0
                    },
                    series: [{
                            name: '<? echo $evento->getTitulo(); ?>',
                            data: [<? echo $dados; ?>]
                        }]
                });
            });


        </script>
    </head>
    <body>
        <?php
        getNavbar();
        ?>


        <div class="container-fluid">
            <div class="row-fluid" style="margin-top: 40px;">
                <h1 align="center"><? echo $empresa->getNome(); ?></h1>
            </div>
            <div class="row-fluid">
                <div class="span3">
                    <div class="navbar">
                        <div class="navbar-inner">
                            <a class="brand" href="">Perfil</a>
                        </div>
                        <div class="container well">
                            <h3 style="margin: 0px;"><?php echo $empresa->getNome(); ?></h3>
                            <? echo '<img class="img-polaroid span12" src="/img/'.($empresa->getImagemPrincipal()->getImagem()).'" style="margin: 0px;" alt=""><br>'; ?>
                            <p>
                            <address>
                                <strong><?php echo $empresa->getNome(); ?></strong><br>
                                <?php echo $empresa->getEndereco()->getDescricao(); ?><br>
                                <?php echo $empresa->getCidade()->getNome().", ".$empresa->getCidade()->getEstado()->getNome()."." ?><br>
                                <abbr title="Telefone">Tel:</abbr> (123) 456-7890<br>
                                <a href="mailto:#"><?echo $empresa->getEmail();?></a>
                            </address>
                            </p>
                        </div>

                    </div>
                </div>
                <div class="span9">
                    <div class="navbar">
                        <div class="navbar-inner">
                            <ul class="nav">
                                <li class="active"><a href="#estatistica" data-toggle="tab"><i class="icon-tasks"> </i> Estatistica</a></li>
                            </ul>
                        </div>
                        <div class="container well">
                            <div class="tab-content">
                                <div class="tab-pane active" id="estatistica">
                                    <?
                                    //$dados = "";
                                    //$categorias = "'" . date('d m Y', strtotime($evento->getHoraCriacao())) . "'" . " ,";
                                    /*$estatisticas = $evento->getEstatisticas();
                                    $dados = "s";
                                    foreach ($estatisticas as $estatitica) {
                                        $dados = $dados.$estatitica->getHora().", ";
                                        echo 'hora: '.$estatitica->getHora();
                                        echo 'dados: '.$dados;
                                        //$categorias . "'" . date('d m Y', strtotime($estatitica->getData())) . "'" . " ,";
                                        echo 'funciona';
                                        
                                    }
                                    echo $dados;*/
                                    ?>

                                    <script src="/js/highcharts.js"></script>
                                    <script src="/js/modules/exporting.js"></script>

                                    <div id="container" style="min-width: 310px; height: 400px; margin: 0 auto"></div>
                                    
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <?
        require_once 'footer.php';
        ?>
    </body>
</html>
